package com.example.demo.service.serviceimpl;

import com.example.demo.dao.UsersDao;
import com.example.demo.entity.UsersEntity;
import com.example.demo.service.UserService;
import com.example.demo.vo.UsersVo;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
@Service
public class UserServiceImpl implements UserService {
    @Resource
    UsersDao usersDao;
    @Override
    public int addUser(UsersVo usersVo) {
        return usersDao.addUser(usersVo) ;
    }

    @Override
    public int delUser(int id) {
        return  usersDao.delUser(id);
    }

    @Override
    public UsersEntity doLogin(String username, String password) {
        return usersDao.doLogin(username,password) ;
    }

    @Override
    public UsersEntity getUserByUsername(String username) {
        return usersDao.getUserByUsername(username);
    }

    @Override
    public int changeUHead(int id, String avatar) {
        return usersDao.changeUHead(id,avatar);
    }

    @Override
    public int updateUser(UsersVo usersVo) {
        return usersDao.updateUser(usersVo);
    }


}
